package chapter02;

public class Test10_Hero {
    public static void main(String[] args) {
        Hero h = new Hero("张三",1000);
    }
}
class Hero{
    private String name;
    private int blood;

    public int getBlood() {
        return blood;
    }

    public void setBlood(int blood) {
        this.blood = blood;
    }

    public Hero(String name, int blood){
        this.name = name;
        this.blood = blood;
    }
    //getter
    public String getName(){
        return this.name;
    }
    //setter
    public void setName(String name){
        this.name = name;
    }
}
